import matplotlib.pyplot as plt
import numpy as np

# 定义类别和两组数据
categories = ["Category A", "Category B", "Category C", "Category D"]
values1 = [25, 30, 15, 5]
values2 = [10, 15, 20, 25]

x = np.array(range(len(categories)))
error1 = np.array([5, 6, 4, 3])

plt.bar(x, values1, width=0.4, label="Values 1", yerr=error1)
plt.show()
